package com.zcl.javaClassAndObject.exception;

/**
 * @Description:
 * @author: zcl
 * @date: 2021/12/14  10:52
 */
public class ExceptionMethods {
    public static void main(String[] args) {
        try {
            throw new Exception("here is my exception");
        }catch (Exception e){
            System.out.println("caught Exception");
            System.out.println("e.getMessage(): "+ e.getMessage());
            System.out.println("e.toString(): "+ e.toString());
            System.out.println("e.printStackTrace(): ");
            e.printStackTrace();
        }
    }
}
/**
 * caught Exception
 * e.getMessage(): here is my exception
 * e.toString(): java.lang.Exception: here is my exception
 * e.printStackTrace():
 * java.lang.Exception: here is my exception
 * 	at com.zcl.javaClassAndObject.exception.ExceptionMethods.main(ExceptionMethods.java:11)
 * */